<html>
<head>
  <title>11-连接的原理</title>
  <basefont face="微软雅黑" size="2" />
  <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
  <meta name="exporter-version" content="YXBJ Windows/600646 (zh-CN, DDL); Windows/6.1.1 (Win64);"/>
  <meta name="content-class" content="yinxiang.markdown"/>
  <style>
    body, td {
      font-family: 微软雅黑;
      font-size: 10pt;
    }
  </style>
</head>
<body>
<a name="719"/>
<h1>11-连接的原理</h1>

<div><span><div style="font-size: 14px; margin: 0; padding: 0; width: 100%;"><h2 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 34px; border-bottom: 1px solid #dbdbdb; color: #333;">1 连接简介</h2>
<h3 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 27px; color: #333;">1-1 连接的本质</h3>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">示例表：<br/>
<img src="11-连接的原理_files/Image.png" type="image/png" data-filename="Image.png"/></p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">连接的本质</strong>就是把各个连接表中的记录都取出来依次匹配的组合加入结果集并返回给用户。所以把t1和t2两个表连接起来的过程如下：<br/>
<img src="11-连接的原理_files/1.jpg" type="image/jpeg" data-filename="1.jpg"/></p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">这个过程看起来就是把t1表的记录和t2的记录连起来组成新的更大的记录，所以这个查询过程称之为连接查询。连接查询的结果集中包含一个表中的每一条记录与另一个表中的每一条记录相互匹配的组合，像这样的结果集就可以称之为<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">笛卡尔积</strong>。</p>
<h3 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 27px; color: #333;">1-2 连接过程简介</h3>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">在连接查询中的过滤条件可以分为2种：</p>
<ul style="line-height: 160%; box-sizing: content-box; display: block; list-style-type: disc; padding-left: 30px; margin: 6px 0 10px; color: #333;">
<li style="line-height: 160%; box-sizing: content-box; position: relative;">涉及单表的条件，如：t1.m1 &gt; 1</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">涉及量表的条件，如：t1.m1 = t2.m2</li>
</ul>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">比如下面的查询：<br/>
SELECT * FROM t1, t2 WHERE t1.m1 &gt; 1 AND t1.m1 = t2.m2 AND t2.n2 &lt; 'd'；</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">在查询时用到三个过滤条件：</p>
<ul style="line-height: 160%; box-sizing: content-box; display: block; list-style-type: disc; padding-left: 30px; margin: 6px 0 10px; color: #333;">
<li style="line-height: 160%; box-sizing: content-box; position: relative;">t1.m1 &gt; 1</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">t1.m1 = t2.m2</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">t2.n2 &lt; 'd'</li>
</ul>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">那么这个连接查询的大致执行过程如下：</p>
<ol style="line-height: 160%; box-sizing: content-box; display: block; padding-left: 30px; margin: 6px 0 10px; color: #333; list-style-type: decimal;">
<li style="line-height: 160%; box-sizing: content-box;">
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">首先确定第一个需要查询的表，这个表称之为<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">驱动表</strong>，此处假设使用t1作为驱动表，那么就需要到t1表中找满足t1.m1 &gt; 1的记录：<br/>
<img src="11-连接的原理_files/1 [1].jpg" type="image/jpeg" data-filename="1.jpg"/></p>
</li>
<li style="line-height: 160%; box-sizing: content-box;">
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">针对上一步骤中从驱动表产生的结果集中的每一条记录，分别需要到t2表中查找匹配的记录，所谓匹配的记录，指的是符合过滤条件的记录。因为是根据t1表中的记录去找t2表中的记录，所以t2表也可以被称之为<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">被驱动表</strong>。上一步骤从驱动表中得到了2条记录，所以需要查询2次t2表。此时涉及两个表的列的过滤条件t1.m1 = t2.m2就派上用场了：<img src="11-连接的原理_files/1 [2].jpg" type="image/jpeg" data-filename="1.jpg"/></p>
</li>
</ol>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">也就是说整个连接查询最后的结果只有两条符合过滤条件的记录：<img src="11-连接的原理_files/Image [1].png" type="image/png" data-filename="Image.png"/></p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">也就是说在两表连接查询中，驱动表只需要访问一次，被驱动表可能被访问多次。</strong></p>
<h3 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 27px; color: #333;">1-3 内连接和外连接</h3>
<h4 style="line-height: 160%; box-sizing: content-box; font-size: 20px; color: #333;">内连接</h4>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">对于<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">内连接</strong>的两个表，驱动表中的记录在被驱动表中找不到匹配的记录，该记录不会加入到最后的结果集。</p>
<h4 style="line-height: 160%; box-sizing: content-box; font-size: 20px; color: #333;">外连接</h4>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">对于<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">外连接</strong>的两个表，驱动表中的记录即使在被驱动表中没有匹配的记录，也仍然需要加入到结果集。<br/>
在MySQL中，根据选取的驱动表的不同，外连接仍然可以细分为2种：<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">左外连接</strong>（左侧表为驱动表）和<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">右外连接</strong>（右侧表为驱动表）</p>
<ul style="line-height: 160%; box-sizing: content-box; display: block; list-style-type: disc; padding-left: 30px; margin: 6px 0 10px; color: #333;">
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">WHERE</strong>子句中的过滤条件<br/>
WHERE子句中的过滤条件就是我们平时见的那种，不论是内连接还是外连接，凡是不符合WHERE子句中的过滤条件的记录都不会被加入最后的结果集。</p>
</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">ON</strong>子句中的过滤条件<br/>
对于外连接的驱动表的记录来说，如果<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">无法在被驱动表中找到匹配ON子句中的过滤条件的记录</strong>，那么该记录仍然会被加入到结果集中，<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">对应的被驱动表记录的各个字段使用NULL值填充</strong>。</p>
</li>
</ul>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">需要注意的是，这个ON子句是专门为外连接驱动表中的记录在被驱动表找不到匹配记录时应不应该把该记录加入结果集这个场景下提出的，所以如果把ON子句放到内连接中，MySQL会把它和WHERE子句一样对待，也就是说：内连接中的WHERE子句和ON子句是等价的。</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">一般情况下，我们都把只涉及单表的过滤条件放到WHERE子句中，把涉及两表的过滤条件都放到ON子句中，我们也一般把放到ON子句中的过滤条件也称之为连接条件。</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">对于内连接来说，驱动表和被驱动表是可以互换的，并不会影响最后的查询结果。但是对于外连接来说，由于驱动表中的记录即使在被驱动表中找不到符合ON子句连接条件的记录，所以此时驱动表和被驱动表的关系就很重要了，也就是说左外连接和右外连接的驱动表和被驱动表不能轻易互换。由于在内连接中ON子句和WHERE子句是等价的，所以内连接中不要求强制写明ON子句。</strong></p>
<h2 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 34px; border-bottom: 1px solid #dbdbdb; color: #333;">2 连接的原理</h2>
<h3 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 27px; color: #333;">2-1 嵌套循环连接（Nested-Loop Join）</h3>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">我们前边说过，对于两表连接来说，驱动表只会被访问一遍，但被驱动表却要被访问到好多遍，具体访问几遍取决于对驱动表执行单表查询后的结果集中的记录条数。对于内连接来说，选取哪个表为驱动表都没关系，而外连接的驱动表是固定的，也就是说左（外）连接的驱动表就是左边的那个表，右（外）连接的驱动表就是右边的那个表。我们上边已经大致介绍过t1表和t2表执行内连接查询的大致过程，我们温习一下：</p>
<ul style="line-height: 160%; box-sizing: content-box; display: block; list-style-type: disc; padding-left: 30px; margin: 6px 0 10px; color: #333;">
<li style="line-height: 160%; box-sizing: content-box; position: relative;">步骤1：选取驱动表，使用与驱动表相关的过滤条件，选取代价最低的单表访问方法来执行对驱动表的单表查询；</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">步骤2：对上一步骤中查询驱动表得到的结果集中每一条记录，都分别到被驱动表中查找匹配的记录；<br/>
<img src="11-连接的原理_files/1 [3].jpg" type="image/jpeg" data-filename="1.jpg"/></li>
</ul>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">如果有3个表进行连接的话，那么步骤2中得到的结果集就像是新的驱动表，然后第三个表就成为了被驱动表，重复上边过程，也就是步骤2中得到的结果集中的每一条记录都需要到t3表中找一找有没有匹配的记录，用伪代码表示一下这个过程就是这样：<br/>
<img src="11-连接的原理_files/Image [2].png" type="image/png" data-filename="Image.png"/></p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">这个过程就像是<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">一个嵌套的循环，所以这种驱动表只访问一次，但被驱动表却可能被多次访问，访问次数取决于对驱动表执行单表查询后的结果集中的记录条数的连接执行方式称之为嵌套循环连接（Nested-Loop Join）</strong>，这是最简单，也是最笨拙的一种连接查询算法。</p>
<h4 style="line-height: 160%; box-sizing: content-box; font-size: 20px; color: #333;">使用索引加快连接速度</h4>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">例如查询：<br/>
SELECT * FROM t1, t2 WHERE t1.m1 &gt; 1 AND t1.m1 = t2.m2 AND t2.n2 &lt; 'd'；</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">可以看到，原来的t1.m1 = t2.m2这个涉及两个表的过滤条件在针对t2表做查询时关于t1表的条件就已经确定了，所以我们只需要单单优化对t2表的查询了，上述两个对t2表的查询语句中利用到的列是m2和n2列：</p>
<ul style="line-height: 160%; box-sizing: content-box; display: block; list-style-type: disc; padding-left: 30px; margin: 6px 0 10px; color: #333;">
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;">在m2列上建立索引<br/>
因为对m2列的条件是等值查找，比如t2.m2 = 2、t2.m2 = 3等，所以可能使用到ref的访问方法，假设使用ref的访问方法去执行对t2表的查询的话，需要回表之后再判断t2.n2 &lt; d这个条件是否成立。<br/>
这里有一个比较特殊的情况，就是<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">假设m2列是t2表的主键或者唯一二级索引列</strong>，那么使用t2.m2 = 常数值这样的条件从t2表中查找记录的过程的代价就是常数级别的。我们知道在单表中使用主键值或者唯一二级索引列的值进行等值查找的方式称之为const，而MySQL把<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">在连接查询中对被驱动表使用主键值或者唯一二级索引列的值进行等值查找的查询执行方式称之为：eq_ref</strong>。</p>
</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;">在n2列上建立索引<br/>
涉及到的条件是t2.n2 &lt; 'd'，可能用到range的访问方法，假设使用range的访问方法对t2表的查询的话，需要回表之后再判断在m2列上的条件是否成立。</p>
</li>
</ul>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">假设m2和n2列上都存在索引的话，那么就需要从这两个里边儿挑一个代价更低的去执行对t2表的查询。当然，建立了索引不一定使用索引，只有在二级索引 + 回表的代价比全表扫描的代价更低时才会使用索引。<br/>
另外，有时候连接查询的查询列表和过滤条件中可能只涉及被驱动表的部分列，而这些列都是某个索引的一部分，这种情况下即使不能使用eq_ref、ref、ref_or_null或者range这些访问方法执行对被驱动表的查询的话，也可以使用索引扫描，也就是<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">index的访问方法</strong>来查询被驱动表。所以我们建议在真实工作中<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">最好不要使用*作为查询列表</strong>，最好把真实用到的列作为查询列表。</p>
<h3 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 27px; color: #333;">2-2 基于块的嵌套循环连接（Block Nested-Loop Join）</h3>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">扫描一个表的过程其实是先把这个表从磁盘上加载到内存中，然后从内存中比较匹配条件是否满足。现实生活中的表可不像t1、t2这种只有3条记录，成千上万条记录都是少的，几百万、几千万甚至几亿条记录的表到处都是。内存里可能并不能完全存放的下表中所有的记录，所以在扫描表前边记录的时候后边的记录可能还在磁盘上，等扫描到后边记录的时候可能内存不足，所以需要把前边的记录从内存中释放掉。我们前边又说过，采用嵌套循环连接算法的两表连接过程中，被驱动表可是要被访问好多次的，如果这个被驱动表中的数据特别多而且不能使用索引进行访问，那就相当于要从磁盘上读好几次这个表，<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">这个I/O代价就非常大了</strong>，所以我们得想办法：<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">尽量减少访问被驱动表的次数</strong>。</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">当被驱动表中的数据非常多时，每次访问被驱动表，被驱动表的记录会被加载到内存中，在内存中的每一条记录只会和驱动表结果集的一条记录做匹配，之后就会被从内存中清除掉。然后再从驱动表结果集中拿出另一条记录，再一次把被驱动表的记录加载到内存中一遍，周而复始，驱动表结果集中有多少条记录，就得把被驱动表从磁盘上加载到内存中多少次。所以我们可不可以在把被驱动表的记录加载到内存的时候，一次性和多条驱动表中的记录做匹配，这样就可以大大减少重复从磁盘上加载被驱动表的代价了。所以设计MySQL的大叔提出了一个<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">join buffer</strong>的概念，<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">join buffer就是执行连接查询前申请的一块固定大小的内存，先把若干条驱动表结果集中的记录装在这个join buffer中</strong>，然后开始扫描被驱动表，每一条被驱动表的记录一次性和join buffer中的多条驱动表记录做匹配，因为匹配的过程都是在内存中完成的，所以这样可以显著减少被驱动表的I/O代价。使用join buffer的过程如下图所示：<img src="11-连接的原理_files/1 [4].jpg" type="image/jpeg" data-filename="1.jpg"/></p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">最好的情况是join buffer足够大，能容纳驱动表结果集中的所有记录，这样只需要访问一次被驱动表就可以完成连接操作了。MySQL把这种加入了join buffer的嵌套循环连接算法称之为基于块的嵌套连接（Block Nested-Loop Join）算法。</strong></p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">这个<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">join buffer的大小是可以通过启动参数或者系统变量join_buffer_size进行配置</strong>，默认大小为262144字节（也就是256KB），最小可以设置为128字节。当然，<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">对于优化被驱动表的查询来说，最好是为被驱动表加上效率高的索引，如果实在不能使用索引，并且自己的机器的内存也比较大可以尝试调大join_buffer_size的值来对连接查询进行优化。</strong><br/>
另外需要注意的是，驱动表的记录并不是所有列都会被放到join buffer中，只有查询列表中的列和过滤条件中的列才会被放到join buffer中，所以再次提醒我们，最好不要把*作为查询列表，只需要把我们关心的列放到查询列表就好了，这样还可以在join buffer中放置更多的记录。</p>
</div><center style="display:none !important;visibility:collapse !important;height:0 !important;white-space:nowrap;width:100%;overflow:hidden">%23%23%201%20%E8%BF%9E%E6%8E%A5%E7%AE%80%E4%BB%8B%0A%0A%23%23%23%201-1%20%E8%BF%9E%E6%8E%A5%E7%9A%84%E6%9C%AC%E8%B4%A8%0A%E7%A4%BA%E4%BE%8B%E8%A1%A8%EF%BC%9A%0A!%5B835892e649f758cad13d8c828680cd25.png%5D(en-resource%3A%2F%2Fdatabase%2F721%3A0)%0A%0A**%E8%BF%9E%E6%8E%A5%E7%9A%84%E6%9C%AC%E8%B4%A8**%E5%B0%B1%E6%98%AF%E6%8A%8A%E5%90%84%E4%B8%AA%E8%BF%9E%E6%8E%A5%E8%A1%A8%E4%B8%AD%E7%9A%84%E8%AE%B0%E5%BD%95%E9%83%BD%E5%8F%96%E5%87%BA%E6%9D%A5%E4%BE%9D%E6%AC%A1%E5%8C%B9%E9%85%8D%E7%9A%84%E7%BB%84%E5%90%88%E5%8A%A0%E5%85%A5%E7%BB%93%E6%9E%9C%E9%9B%86%E5%B9%B6%E8%BF%94%E5%9B%9E%E7%BB%99%E7%94%A8%E6%88%B7%E3%80%82%E6%89%80%E4%BB%A5%E6%8A%8At1%E5%92%8Ct2%E4%B8%A4%E4%B8%AA%E8%A1%A8%E8%BF%9E%E6%8E%A5%E8%B5%B7%E6%9D%A5%E7%9A%84%E8%BF%87%E7%A8%8B%E5%A6%82%E4%B8%8B%EF%BC%9A%0A!%5B59a4a0d9da7379a00a02d22052ef9528.jpeg%5D(en-resource%3A%2F%2Fdatabase%2F723%3A0)%0A%0A%E8%BF%99%E4%B8%AA%E8%BF%87%E7%A8%8B%E7%9C%8B%E8%B5%B7%E6%9D%A5%E5%B0%B1%E6%98%AF%E6%8A%8At1%E8%A1%A8%E7%9A%84%E8%AE%B0%E5%BD%95%E5%92%8Ct2%E7%9A%84%E8%AE%B0%E5%BD%95%E8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9A%84%E8%BF%87%E7%A8%8B%E9%83%BD%E6%98%AF%E5%9C%A8%E5%86%85%E5%AD%98%E4%B8%AD%E5%AE%8C%E6%88%90%E7%9A%84%EF%BC%8C%E6%89%80%E4%BB%A5%E8%BF%99%E6%A0%B7%E5%8F%AF%E4%BB%A5%E6%98%BE%E8%91%97%E5%87%8F%E5%B0%91%E8%A2%AB%E9%A9%B1%E5%8A%A8%E8%A1%A8%E7%9A%84I%2FO%E4%BB%A3%E4%BB%B7%E3%80%82%E4%BD%BF%E7%94%A8join%20buffer%E7%9A%84%E8%BF%87%E7%A8%8B%E5%A6%82%E4%B8%8B%E5%9B%BE%E6%89%80%E7%A4%BA%EF%BC%9A!%5B51e70f154892b72f7fc64681d88260c2.jpeg%5D(en-resource%3A%2F%2Fdatabase%2F735%3A0)%0A%0A**%E6%9C%80%E5%A5%BD%E7%9A%84%E6%83%85%E5%86%B5%E6%98%AFjoin%20buffer%E8%B6%B3%E5%A4%9F%E5%A4%A7%EF%BC%8C%E8%83%BD%E5%AE%B9%E7%BA%B3%E9%A9%B1%E5%8A%A8%E8%A1%A8%E7%BB%93%E6%9E%9C%E9%9B%86%E4%B8%AD%E7%9A%84%E6%89%80%E6%9C%89%E8%AE%B0%E5%BD%95%EF%BC%8C%E8%BF%99%E6%A0%B7%E5%8F%AA%E9%9C%80%E8%A6%81%E8%AE%BF%E9%97%AE%E4%B8%80%E6%AC%A1%E8%A2%AB%E9%A9%B1%E5%8A%A8%E8%A1%A8%E5%B0%B1%E5%8F%AF%E4%BB%A5%E5%AE%8C%E6%88%90%E8%BF%9E%E6%8E%A5%E6%93%8D%E4%BD%9C%E4%BA%86%E3%80%82MySQL%E6%8A%8A%E8%BF%99%E7%A7%8D%E5%8A%A0%E5%85%A5%E4%BA%86join%20buffer%E7%9A%84%E5%B5%8C%E5%A5%97%E5%BE%AA%E7%8E%AF%E8%BF%9E%E6%8E%A5%E7%AE%97%E6%B3%95%E7%A7%B0%E4%B9%8B%E4%B8%BA%E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E8%BF%98%E5%8F%AF%E4%BB%A5%E5%9C%A8join%20buffer%E4%B8%AD%E6%94%BE%E7%BD%AE%E6%9B%B4%E5%A4%9A%E7%9A%84%E8%AE%B0%E5%BD%95%E3%80%82</center></span>
</div></body></html> 